home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-06 | 3.3 KB | 162 lines | [TEXT/MPS ] |
- // Copyright © 1991 Apple Computer, Inc. All rights reserved.
-
- #ifndef __UDIALOGS__
- #include "UDialogs.h"
- #endif
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
- #ifndef __FONTS__
- #include <Fonts.h>
- #endif
-
- #ifndef __RESOURCES__
- #include <Resources.h>
- #endif
-
- #ifndef __PACKAGES__
- #include <Packages.h>
- #endif
-
- #ifndef __UMEMORY__
- #include <UMemory.h>
- #endif
-
- #ifndef __USCROLLER__
- #include <UScroller.h>
- #endif
-
- #ifndef __UVIEWSERVER__
- #include <UViewServer.h>
- #endif
-
- #ifndef __UDRAWINGENVIRONMENT__
- #include <UDrawingEnvironment.h>
- #endif
-
- #ifndef __UFAILURE__
- #include <UFailure.h>
- #endif
-
- #ifndef __UGEOMETRY__
- #include <UGeometry.h>
- #endif
-
- #ifndef __UMACAPPUTILITIES__
- #include <UMacAppUtilities.h>
- #endif
-
- #ifndef __MENUS__
- #include <Menus.h>
- #endif
-
- #ifndef __UMENUMGR__
- #include <UMenuMgr.h>
- #endif
-
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
-
- #ifndef __UWINDOW__
- #include <UWindow.h>
- #endif
-
-
- #ifndef __UCONTROL__
- #include <UControl.h>
- #endif
-
-
- #define kSignature 'MOOF' // qpplication signature
- #define kFileType 'SF01' // file type code used for document files created by this application
-
- const short kModelessID = 2000;
-
-
- //----------------------------------------------------------------------------
- #undef Inherited
- #define Inherited TApplication
-
- #pragma segment AInit
- DefineClass(TDialogsApplication, TApplication);
-
- void TDialogsApplication::IDialogsApplication()
- {
-
- TWindow* aWindow;
-
- this->IApplication(kFileType, kSignature);
-
- fLaunchWithNewDocument = false; // Suppress the creation of a new document at launch
-
- // make sure the linker doesn't strip out the code for TModelessView
- macroDontDeadStrip(TModelessView);
-
- // create our modeless dialog
- FailNIL(aWindow = gViewServer->NewTemplateWindow(kModelessID, NULL));
- aWindow->Open();
-
- }
-
-
- //------------------------------------------------------------------------------
-
- #pragma segment AInit
- void TDialogsApplication::HandleFinderRequest()
- {
- // don't open application by clicking on file
- }
-
-
- //------------------------------------------------------------------------------
- #undef Inherited
- #define Inherited TDialogView
-
- #pragma segment ARes
- DefineClass(TModelessView, TDialogView);
-
- void TModelessView::DoEvent(EventNumber eventNumber,
- TEventHandler* source,
- TEvent* event)// override
- {
- TEditText *anEditText1 = (TEditText *) this->FindSubView('edit');
- TEditText *anEditText2 = (TEditText *) this->FindSubView('edi2');
-
- switch (eventNumber){
- case mRadioHit: // do something with the radio button selection
- {
- if (source == (this -> FindSubView('sel1')))
- {
-
- anEditText2->DimState(TRUE,kDontRedraw); // disable
- anEditText2->ViewEnable(FALSE,kRedraw);
- anEditText2->StopEdit();
-
- anEditText1->DimState(FALSE,kDontRedraw); // enable
- anEditText1->ViewEnable(TRUE,kRedraw);
- anEditText1->StartEdit(TRUE);
- }
-
- else if (source == (this -> FindSubView('sel2')))
-
- {
- anEditText1->DimState(TRUE,kDontRedraw); // disable
- anEditText1->ViewEnable(FALSE,kRedraw);
- anEditText1->StopEdit();
-
- anEditText2->DimState(FALSE,kDontRedraw); // enable
- anEditText2->ViewEnable(TRUE,kRedraw);
- anEditText2->StartEdit(TRUE);
- }
- break; // case mRadioHit
- }
- default: Inherited::DoEvent(eventNumber, source, event);
-
- }
- } // TModelessView::DoEvent
-
-
-